a[100];
main(n,k,h,t,c,s,b)
{
	for(gets(&n);~scanf("%d%d",&n,&k);printf("%d\n",c))
	{
		for(h=0;h<n;scanf("%d",a+h++));
		for(h=t=c=0;h<n;t=++h,s=0)
			while(t<n)
			{
				s+=a[t++],s%k?:c++;
				if(!(s%k))
					printf("L(%d, %d)\n",t,h+1);
			}
	}
}
